<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑联系人</title>
    <style>
        .btn {
            display: inline-block;
            width: 80px;
            height: 24px;
            background-color: red;
            color: white;
            text-decoration: none;
            text-align: center;
            margin: 10px 0;
            border: none;
        }
    </style>
</head>
<body>
<h3>编辑联系人</h3>
{% if contact %}
<form action="{% url 'contact:edit_contact' contact.id %}" method="post">
    {% csrf_token %}
    姓名：<input type="text" name="name" id="name" value="{{ contact.name }}"><br>
    性别：<input type="text" name="gender" id="gender" value="{{ contact.gender }}"><br>
    电话：<input type="tel" name="phone" id="phone" value="{{ contact.phone }}"><br>
<!--    时间：<input type="datetime-local" name="pub_date" id="pub_date" value="contant.pub_date"><br>-->
    <input type="submit" class="btn" value="修改">
</form>
{% else %}
<p>暂无记录</p>
{% endif %}
<a href="{% url 'contact:index' %}" class="btn">返回</a>
</body>
</html>